package daily.may0522;

import java.util.Enumeration;
import java.util.Properties;

public class PropertiesTest {
    public static void main(String[] args) {
        //创建Properties对象
        Properties p = new Properties();
        //
        p.setProperty("background-color", "red");
        p.setProperty("Font-size", "14px");
        p.setProperty("Language", "chinese");
        //获取Enumeration对象所有键的枚举
        Enumeration names = p.propertyNames();
        //循环遍历所有的键
        while (names.hasMoreElements()) {
            String key = (String) names.nextElement();
            //获取对应键的值
            String value = p.getProperty(key);
            System.out.println(key + " = " + value);
        }
    }
}
